package messages;


/**
 * Login message
 * 
 * The login message is sent by the client to authenticate himself.
 * This message is not handled by a correspondent Command. Instead,
 * the Controller handles it through its authenthicate() method.
 */
public class LoginMessage extends Message {
	private static final long serialVersionUID = 1L;
	
	public LoginMessage(String login, String password) {
		super();
		
		this.login = login;
		this.password = password;
		this.isRetry = false;
	}
	
	
	public LoginMessage(String login, String password, boolean isRetry) {
		this(login, password);
		this.isRetry = isRetry;
	}
	
	
	public String getLogin() {
		return this.login;
	}
	
	
	public String getPassword() {
		return this.password;
	}
	
	
	public boolean isRetry() {
		return isRetry;
	}
	
	
	@Override
	public String toString() {
		return super.toString() + " Login (" + this.login + ") password = " + this.password + " retry = " + isRetry;
	}
	
	private String login;	 // User login
	private String password; // User password
	private boolean isRetry; // Is the client retrying to connect?
}
